<template>
	<view>
		<view class="detailView">
			<!--基础信息-->
			<view class="baseInfo">
				<view class="title">基础信息</view>
				<view class="infoItem">
					<text class="label">供应商名称：</text>
					<text class="value">{{supplierInfo.name || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">联系人：</text>
					<text class="value">{{supplierInfo.linkman || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">联系方式：</text>
					<text class="value">{{supplierInfo.mobile || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">地址：</text>
					<text class="value">{{supplierInfo.address || '暂无'}}</text>
				</view>
			</view>

			<!--分类信息-->
			<view class="categoryInfo">
				<view class="title">分类信息</view>
				<view class="infoItem">
					<text class="label">供应商类型：</text>
					<text class="value">{{supplierInfo.suppliertype || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">供应商等级：</text>
					<text class="value">{{supplierInfo.level || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">供应商行业：</text>
					<text class="value">{{supplierInfo.industry || '暂无'}}</text>
				</view>
			</view>

			<!--系统信息-->
			<view class="systemInfo">
				<view class="title">系统信息</view>
				<view class="infoItem">
					<text class="label">创建人：</text>
					<text class="value">{{supplierInfo.create_user_name || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">负责人：</text>
					<text class="value">{{supplierInfo.owner_user_name || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">创建时间：</text>
					<text class="value">{{formatDate(supplierInfo.create_time) || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">更新时间：</text>
					<text class="value">{{formatDate(supplierInfo.update_time) || '暂无'}}</text>
				</view>
				<view class="infoItem">
					<text class="label">状态：</text>
					<text class="value">{{supplierInfo.openstatus == 0 ? '公开' : '私有'}}</text>
				</view>
			</view>

			<!--备注信息-->
			<view v-if="supplierInfo.remark" class="remarkInfo">
				<view class="title">备注信息</view>
				<view class="remarkContent">
					<text>{{supplierInfo.remark}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			supplierInfo: {
				type: Object,
				default: () => {}
			}
		},
		methods: {
			formatDate(date) {
				if (!date) return '';
				return this.$u.timeFrom(date, 'yyyy-mm-dd');
			}
		}
	}
</script>

<style scoped>
	.detailView {
		padding: 32rpx;
		background-color: #FFFFFF;
		margin: 20rpx;
		border-radius: 16rpx;
		box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);
	}

	.title {
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		margin-bottom: 24rpx;
		padding-left: 20rpx;
		border-left: 8rpx solid #007AFF;
	}

	.baseInfo,
	.categoryInfo,
	.systemInfo,
	.remarkInfo {
		margin-bottom: 40rpx;
	}

	.infoItem {
		display: flex;
		margin-bottom: 20rpx;
		font-size: 28rpx;
		line-height: 1.5;
	}

	.label {
		color: #666666;
		width: 200rpx;
		flex-shrink: 0;
	}

	.value {
		color: #333333;
		flex: 1;
	}

	.remarkContent {
		background-color: #f8f9fa;
		padding: 24rpx;
		border-radius: 8rpx;
		line-height: 1.6;
		color: #666666;
		font-size: 28rpx;
	}
</style>